package metier.Service;

import java.util.Date;
import java.util.List;

import javax.ejb.EJB;
import javax.ejb.Stateless;
import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebService;

import metier.entities.Vue;
import metier.sess.IVueLocal;


@Stateless
@WebService
public class VueService {
	@EJB(beanName="Vue")
	private IVueLocal metier;
	
	
	@WebMethod
	public void addVue(@WebParam(name="IP")String IP)
	{
		Vue v=new Vue(new Date(), IP);
		metier.addVue(v);
	}
	
	
	@WebMethod
	public List<Vue> listVue()
	{
		return metier.getAllVue();
	}
	
	@WebMethod 
	public Vue getVue(@WebParam(name="Id")Integer Id)
	{
		return metier.getVue(Id);
	}
	
	
	@WebMethod
	public void UpdateVue(@WebParam(name="Id")Integer Id,@WebParam(name="date")Date d,@WebParam(name="IP")String IP)
	{
	     Vue v=metier.getVue(Id);
	     v.setDate(d);
	     v.setIP(IP);
		metier.updateVue(v);
		
	}
	
	@WebMethod
	public void DeleteTransport(@WebParam(name="Id")Integer Id)
	{
		metier.deleteVue(Id);
	}
	
	
	
	

}
